package com.banmao.desktoptools;

import com.banmao.desktoptools.util.FileIconUtil;
import de.felixroske.jfxsupport.AbstractJavaFxApplicationSupport;
import javafx.application.Application;
import javafx.stage.Stage;
import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.Field;
import java.util.Map;

@Slf4j
public class FXMain extends AbstractJavaFxApplicationSupport {
    //@Override
    //public void start(Stage primaryStage) throws Exception {
    //    primaryStage.show();
    //}


    @Override
    public void stop() throws Exception {
        super.stop();

        log.info("开始关闭程序前操作");
        Field field = FileIconUtil.class.getDeclaredField("mapOfFileExtToSmallIcon");
        field.setAccessible(true);
        Map map = (Map) field.get(FileIconUtil.class);
        for (Object key : map.keySet()) {
            // TODO 需要将对象序列化，存入文件才有意义
        }


    }
}
